package opensocial4gwt;


public final class Enum<TYPE> extends BaseJsObject {
	public static enum Gender {
		MALE, FEMALE;
		
		public native String value() /*-{
			return $wnd.opensocial.Enum.Gender[this.@opensocial4gwt.Enum.Gender::name()()];
		}-*/;
	}
	
	protected Enum() {
	}
	
	public TYPE getKey() {
		String key = getKeyString();
		if ("MALE".equals(key))
			return (TYPE) Gender.MALE;
		else if ("FEMALE".equals(key))
			return (TYPE) Gender.FEMALE;
		return null;
	}
	
	private native String getKeyString() /*-{
		return this.getKey();
	}-*/;

	public native String getDisplayValue() /*-{
		return this.displayValue();
	}-*/;

}
